<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件


/**
     * 密码加密
     * @param string $password
     * 
     * @return string 
     */
    function hashPwd($password)
    {
        return password_hash($password, PASSWORD_DEFAULT);
    }
    
    /**
     * 验证密码
     * @param string $password
     * @param string $hash
     * 
     * @return bool
     */
    function verifyPwd($password, $hash)
    {
        return password_verify($password, $hash);
    }

    /**
     *  生成token
     **/
    function generateSessionToken()
    {
        return md5(uniqid(microtime(), true));
    }
const BASE_URL="http://xinwujia.com";
